﻿@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<dynamic>
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>  
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />    
    <link href="~/Content/Site.css" rel="stylesheet" type="text/css" />    
</head>
<body>
    <div id="header">
        <h1><a href="/">NancyFx MUSIC STORE</a></h1>
        <ul id="navlist">
            <li class="first"><a href="/" id="current">Home</a></li>
            <li><a href="/store">Store</a></li>            
            <li><a id="cart-status" href="/shoppingcart/index"></a></li>
            <li><a href="/storemanager">Admin</a></li>
        </ul>
    </div>
    
    <ul id="categories">       
    </ul>
   
    <div id="main">
        @RenderBody()
    </div>

    <div id="footer">
        built with <a href="http://nancyfx.org">Nancy 1.4.3</a>
    </div>

    <script src="~/Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $.ajax({
                url: "/store/genremenu",
                method: "get",
                dataType: "json",
                success: function (res) {
                    for (var i = 0; i < res.length; i++) {
                        $("#categories").append('<li><a href="/store/browse/' + res[i].name + '">' + res[i].name + '</a></li>');
                    }
                }
            });
            $.ajax({
                url: "/shoppingcart/cartsummary",
                method: "get",
                dataType: "json",
                success: function (res) {
                    $("#cart-status").text('Cart (' + res + ')');
                }
            });
        });
    </script>
    @RenderSection("scripts", required: false)         
</body>
</html>